package tvv.levelup.addressDAO.view;

import tvv.levelup.addressDAO.controller.AddressDAO;
import tvv.levelup.addressDAO.controller.IAddressData;
import tvv.levelup.addressDAO.model.Address;

import java.util.LinkedList;
import java.util.List;

public class App 
{
    public static void main( String[] args )
    {

        Address a1 = new Address(1, "Ukrain", "Dnepropetrovsk", "Malinovskogo", "16");
        List<String> numbers1 = new LinkedList<>();
        numbers1.add("+380500503994");
        numbers1.add("+789556339972");
        Address a2 = new Address(2, "Ukrain", "Torez", "Lesnaya", "4");
        List<String> numbers2 = new LinkedList<>();
        numbers2.add("+380502365214");
        numbers2.add("+380502365278");

        a1.addNumbers(numbers1);
        a2.addNumbers(numbers2);


        IAddressData iad = new AddressDAO();
        System.out.println(iad.saveAddress(a1));
        System.out.println(iad.saveAddress(a2));

        System.out.println(iad.getAllAddresses());
        System.out.println("index of last address: " + a1.getAddressCounter());

    }
}
